﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="dsChart" targetNamespace="http://tempuri.org/dsChart.xsd" xmlns:mstns="http://tempuri.org/dsChart.xsd" xmlns="http://tempuri.org/dsChart.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="CrewManagmentConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="CrewManagmentConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.QLTV.Properties.Settings.GlobalReference.Default.CrewManagmentConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblRankTableAdapter" GeneratorDataComponentClassName="tblRankTableAdapter" Name="tblRank" UserDataComponentName="tblRankTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="CrewManagmentConnectionString (Settings)" DbObjectName="CrewManagment.dbo.tblRank" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[tblRank] WHERE (([nRankId] = @Original_nRankId) AND ((@IsNull_cRankName = 1 AND [cRankName] IS NULL) OR ([cRankName] = @Original_cRankName)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_nRankId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="nRankId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_cRankName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_cRankName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[tblRank] ([cRankName]) VALUES (@cRankName);
SELECT nRankId, cRankName, (SELECT COUNT(*) AS Expr1 FROM tblRanking WHERE (rankID = tblRank.nRankId)) AS NumberCrew FROM tblRank WHERE (nRankId = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@cRankName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>select nRankId, cRankName, (select COUNT(*) from tblRanking where tblRanking.rankID = tblRank.nRankId) as NumberCrew
from dbo.tblRank</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[tblRank] SET [cRankName] = @cRankName WHERE (([nRankId] = @Original_nRankId) AND ((@IsNull_cRankName = 1 AND [cRankName] IS NULL) OR ([cRankName] = @Original_cRankName)));
SELECT nRankId, cRankName, (SELECT COUNT(*) AS Expr1 FROM tblRanking WHERE (rankID = tblRank.nRankId)) AS NumberCrew FROM tblRank WHERE (nRankId = @nRankId)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@cRankName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_nRankId" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="nRankId" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_cRankName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_cRankName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="cRankName" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="nRankId" ColumnName="nRankId" DataSourceName="CrewManagment.dbo.tblRank" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@nRankId" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="nRankId" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="nRankId" DataSetColumn="nRankId" />
              <Mapping SourceColumn="cRankName" DataSetColumn="cRankName" />
              <Mapping SourceColumn="NumberCrew" DataSetColumn="NumberCrew" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblAgeTableAdapter" GeneratorDataComponentClassName="tblAgeTableAdapter" Name="tblAge" UserDataComponentName="tblAgeTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="CrewManagmentConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>select '&lt; 18' as RangeAge,(select COUNT(*) from dbo.tblCrew where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) &lt; 18) as NumberCrew
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) &lt; 18
union
select '18 - 25' as RangeAge, (select COUNT(*) from dbo.tblCrew where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 18 and 25) as NumberCrew
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 18 and 25
union
select '25 - 30' as RangeAge, (select COUNT(*) from dbo.tblCrew where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 25 and 30) as NumberCrew
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 25 and 30
union
select '30 - 40' as RangeAge, (select COUNT(*) from dbo.tblCrew where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 30 and 40) as NumberCrew
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 30 and 40
union
select '40 - 50' as RangeAge, (select COUNT(*) from dbo.tblCrew where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 40 and 50) as NumberCrew
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) between 40 and 50
union
select '&gt; 50' as RangeAge, DATEDIFF(YEAR,dDateOfBirth,GETDATE()) as Age
from dbo.tblCrew
where DATEDIFF(YEAR,dDateOfBirth,GETDATE()) &gt; 50</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="RangeAge" DataSetColumn="RangeAge" />
              <Mapping SourceColumn="NumberCrew" DataSetColumn="NumberCrew" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblSexTableAdapter" GeneratorDataComponentClassName="tblSexTableAdapter" Name="tblSex" UserDataComponentName="tblSexTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="CrewManagmentConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>select 'Male' as Sex, (select COUNT(*) from tblCrew where tblCrew.cSex = 'Male') as NumberCrew
from tblCrew
union
select 'Female' as Sex, (select COUNT(*) from tblCrew where tblCrew.cSex = 'Female') as NumberCrew
from tblCrew
union
select 'Other' as Sex, (select COUNT(*) from tblCrew where tblCrew.cSex = 'Other') as NumberCrew
from tblCrew</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Sex" DataSetColumn="Sex" />
              <Mapping SourceColumn="NumberCrew" DataSetColumn="NumberCrew" />
            </Mappings>
            <Sources />
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="tblMaritalTableAdapter" GeneratorDataComponentClassName="tblMaritalTableAdapter" Name="tblMarital" UserDataComponentName="tblMaritalTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="CrewManagmentConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>select 'Married' as [Status], (select COUNT(*) from tblCrew where cMaritalStatus like '%Married%') as NumberCrew
from tblCrew
where cMaritalStatus like '%Married%'
union
select 'Single' as [Status], (select COUNT(*) from tblCrew where cMaritalStatus like '%Single%') as NumberCrew
from tblCrew
where cMaritalStatus like '%Single%'</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Status" DataSetColumn="Status" />
              <Mapping SourceColumn="NumberCrew" DataSetColumn="NumberCrew" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="dsChart" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="dsChart" msprop:Generator_UserDSName="dsChart">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="tblRank" msprop:Generator_TableClassName="tblRankDataTable" msprop:Generator_TableVarName="tabletblRank" msprop:Generator_TablePropName="tblRank" msprop:Generator_RowDeletingName="tblRankRowDeleting" msprop:Generator_UserTableName="tblRank" msprop:Generator_RowChangingName="tblRankRowChanging" msprop:Generator_RowEvHandlerName="tblRankRowChangeEventHandler" msprop:Generator_RowDeletedName="tblRankRowDeleted" msprop:Generator_RowEvArgName="tblRankRowChangeEvent" msprop:Generator_RowChangedName="tblRankRowChanged" msprop:Generator_RowClassName="tblRankRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="nRankId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnnRankId" msprop:Generator_ColumnPropNameInRow="nRankId" msprop:Generator_ColumnPropNameInTable="nRankIdColumn" msprop:Generator_UserColumnName="nRankId" type="xs:int" />
              <xs:element name="cRankName" msprop:Generator_ColumnVarNameInTable="columncRankName" msprop:Generator_ColumnPropNameInRow="cRankName" msprop:Generator_ColumnPropNameInTable="cRankNameColumn" msprop:Generator_UserColumnName="cRankName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NumberCrew" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNumberCrew" msprop:Generator_ColumnPropNameInRow="NumberCrew" msprop:Generator_ColumnPropNameInTable="NumberCrewColumn" msprop:Generator_UserColumnName="NumberCrew" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="tblAge" msprop:Generator_TableClassName="tblAgeDataTable" msprop:Generator_TableVarName="tabletblAge" msprop:Generator_TablePropName="tblAge" msprop:Generator_RowDeletingName="tblAgeRowDeleting" msprop:Generator_UserTableName="tblAge" msprop:Generator_RowChangingName="tblAgeRowChanging" msprop:Generator_RowEvHandlerName="tblAgeRowChangeEventHandler" msprop:Generator_RowDeletedName="tblAgeRowDeleted" msprop:Generator_RowEvArgName="tblAgeRowChangeEvent" msprop:Generator_RowChangedName="tblAgeRowChanged" msprop:Generator_RowClassName="tblAgeRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="RangeAge" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnRangeAge" msprop:Generator_ColumnPropNameInRow="RangeAge" msprop:Generator_ColumnPropNameInTable="RangeAgeColumn" msprop:Generator_UserColumnName="RangeAge" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="7" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NumberCrew" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNumberCrew" msprop:Generator_ColumnPropNameInRow="NumberCrew" msprop:Generator_ColumnPropNameInTable="NumberCrewColumn" msprop:Generator_UserColumnName="NumberCrew" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="tblSex" msprop:Generator_TableClassName="tblSexDataTable" msprop:Generator_TableVarName="tabletblSex" msprop:Generator_TablePropName="tblSex" msprop:Generator_RowDeletingName="tblSexRowDeleting" msprop:Generator_UserTableName="tblSex" msprop:Generator_RowChangingName="tblSexRowChanging" msprop:Generator_RowEvHandlerName="tblSexRowChangeEventHandler" msprop:Generator_RowDeletedName="tblSexRowDeleted" msprop:Generator_RowEvArgName="tblSexRowChangeEvent" msprop:Generator_RowChangedName="tblSexRowChanged" msprop:Generator_RowClassName="tblSexRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Sex" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnSex" msprop:Generator_ColumnPropNameInRow="Sex" msprop:Generator_ColumnPropNameInTable="SexColumn" msprop:Generator_UserColumnName="Sex" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="6" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NumberCrew" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNumberCrew" msprop:Generator_ColumnPropNameInRow="NumberCrew" msprop:Generator_ColumnPropNameInTable="NumberCrewColumn" msprop:Generator_UserColumnName="NumberCrew" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="tblMarital" msprop:Generator_TableClassName="tblMaritalDataTable" msprop:Generator_TableVarName="tabletblMarital" msprop:Generator_TablePropName="tblMarital" msprop:Generator_RowDeletingName="tblMaritalRowDeleting" msprop:Generator_UserTableName="tblMarital" msprop:Generator_RowChangingName="tblMaritalRowChanging" msprop:Generator_RowEvHandlerName="tblMaritalRowChangeEventHandler" msprop:Generator_RowDeletedName="tblMaritalRowDeleted" msprop:Generator_RowEvArgName="tblMaritalRowChangeEvent" msprop:Generator_RowChangedName="tblMaritalRowChanged" msprop:Generator_RowClassName="tblMaritalRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Status" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnStatus" msprop:Generator_ColumnPropNameInRow="Status" msprop:Generator_ColumnPropNameInTable="StatusColumn" msprop:Generator_UserColumnName="Status" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="7" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NumberCrew" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnNumberCrew" msprop:Generator_ColumnPropNameInRow="NumberCrew" msprop:Generator_ColumnPropNameInTable="NumberCrewColumn" msprop:Generator_UserColumnName="NumberCrew" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:tblRank" />
      <xs:field xpath="mstns:nRankId" />
    </xs:unique>
  </xs:element>
</xs:schema>